﻿using Hero.Jwt;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;

namespace Hero.Api.Controllers
{
    [Route("[controller]/[action]")]
    [ApiController]
    public class AuthController : ControllerBase
    {
        private readonly IJwt _jwt;
        public AuthController(IJwt jwt)
        {
            _jwt = jwt;
        }
        [HttpPost]
        public string GetToken(UserInfo userInfo)
        {
            //TODO 用户逻辑判断
            Dictionary<string, object> clims = new Dictionary<string, object>
                {
                    {"UserName", userInfo.UserName }
                };
            var result = _jwt.GetToken(clims);
            return result;
        }
    }
}
